package com.runshu.runshuwulian.base.net;


import com.runshu.runshuwulian.bean.BaseBean;
import com.runshu.runshuwulian.bean.LabelBean;
import com.runshu.runshuwulian.bean.GoodsBean;
import com.runshu.runshuwulian.bean.LoginBean;
import com.runshu.runshuwulian.bean.NullBean;
import com.runshu.runshuwulian.bean.ParentLabelBean;
import com.runshu.runshuwulian.bean.RequestPageBean;
import com.runshu.runshuwulian.bean.XiaoHaoListBean;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface ApiService {

    //    http://yapi.runshutech.com/mock/34/department/queryHospitalDepartment
    public static String Host = "http://yapi.runshutech.com";
    public static String LoginHost = "https://login.runshutech.com";
    public static int HTTP_TIME = 15;

    //网络请求
    @Headers("url_host:user")
    @GET("/mock/34/consumeOrder/scanCodeQueryProductInfo")
    Observable<BaseBean<GoodsBean>> getGoodsInfoByCode(@Query("code") String code);

    //网络请求
    @Headers("url_host:user")
    @GET("/mock/34/consumeOrder/selectOrderStatus")
    Observable<BaseBean<List<LabelBean>>> getCostOrderStatus();
    //网络请求
    @Headers("url_host:user")
    @GET("/mock/34/consumeOrder/app/getAllStatus")
    Observable<BaseBean<List<LabelBean>>> getAllStatus();

    //网络请求
    @Headers("url_host:user")
    @GET("/mock/34/department/queryHospitalDepartment")
    Observable<BaseBean<List<ParentLabelBean>>> getHospitalDepartmentList();

    @FormUrlEncoded
    @Headers("url_host:user")
    @GET("getStudnetInfo")
    Observable<BaseBean<NullBean>> getStudent(@Field("phone") String phone);

    @FormUrlEncoded
    @Headers("url_host:login")
    @POST("api/captcha/capt_cha")
    Observable<BaseBean<String>> getCaptCha(@Field("mobile") String mobile);

    @Headers("Content-Type: application/json")
    @POST("/mock/34/consumeOrder/selectSmallConsumeOrder")
    Observable<BaseBean<XiaoHaoListBean>> getSelectSmallConsumeOrderk(@Body RequestBody body);


//    http://yapi.runshutech.com/mock/34/consumeOrder/scanCodeQueryProductInfo
    //
//    //
////    /**
////     * 上传mp3
////     *
////     * @param type video、image、office
////     *             当type为image时，并需要对图片进行缩率时传thumb。不需要缩略不传
////     *             当type为office时，上传内容为word时传word，为excel时传excel。其它暂不支持
////     * @param file 上传文件
////     * @param path 上传目录（仅支持字母，如member）
////     * @return
////     */
//    @Multipart
//    @POST("upload/file_mp3")
//    Observable<BaseEntity<BeanUpdateFile>> postMp3File(@Part MultipartBody.Part type,
//                                                       @Part MultipartBody.Part file,
//                                                       @Part MultipartBody.Part path);
////
//    /**
//     * 下载文件get请求
//     *
//     * @param url 链接地址
//     * @return
//     */
//    @Streaming
//    @GET
//    Call<ResponseBody> download(@Url String url);

    @FormUrlEncoded
    @Headers("url_host:login")
    @POST("api/loginw/mobile_login")
    Observable<BaseBean<LoginBean>> loginByPhone(@Field("mobile") String mobile,
                                                 @Field("unionID") String unionID, @Field("captcha") String captcha);
}
